home *** CD-ROM | disk | FTP | other *** search
/ Supercompiler 1997 / SUPERCOMPILER97.iso / BC++ Builder / DATA.Z / DATAMOD.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-10  |  1.7 KB  |  40 lines

  1. //----------------------------------------------------------------------------
  2. //Borland C++Builder
  3. //Copyright (c) 1987, 1997 Borland International Inc. All Rights Reserved.
  4. //----------------------------------------------------------------------------
  5. //---------------------------------------------------------------------------
  6. #include <vcl\vcl.h>
  7. #pragma hdrstop
  8.  
  9. #include "datamod.h"
  10. #include "errform.h"
  11. //---------------------------------------------------------------------------
  12. #pragma resource "*.dfm"
  13. TCacheData *CacheData;
  14. //---------------------------------------------------------------------------
  15. __fastcall TCacheData::TCacheData(TComponent* Owner)
  16.   : TDataModule(Owner)
  17. {
  18. }
  19. //---------------------------------------------------------------------
  20. // This event is triggered when an error occurs during the update process
  21. //  (such as a key violation).  Here we use another form to show the user
  22. //  the error and allow them to decide what to do about it.  See ErrForm.cpp
  23. //  for more information
  24. void __fastcall TCacheData::UpdateErrorHandler(TDataSet *DataSet,
  25.       EDatabaseError *E, TUpdateKind UpdateKind,
  26.       TUpdateAction &UpdateAction)
  27. {
  28.    UpdateAction = UpdateErrorForm->HandleError(DataSet, E, UpdateKind);
  29. }
  30. //---------------------------------------------------------------------
  31. // This event displays the current update status in a calculated field
  32. void __fastcall TCacheData::CacheQueryCalcFields(TDataSet *DataSet)
  33. {
  34.    AnsiString UpdateStatusStr[] = {"Unmodified", "Modified", "Inserted", "Deleted"};
  35.  
  36.   if (CacheQuery->CachedUpdates)
  37.     CacheQueryUpdateStatus->Value = UpdateStatusStr[CacheQuery->UpdateStatus()];
  38. }
  39. //---------------------------------------------------------------------
  40.